package com.jintian.smart.platform.system.mapper;

import com.jintian.smart.kernel.orm.mapper.IBaseExtMapper;
import com.jintian.smart.base.api.system.entity.MenuEntity;
import com.jintian.smart.base.api.system.entity.RoleMenuEntity;
import org.beetl.sql.mapper.annotation.Mapper;
import org.beetl.sql.mapper.annotation.Param;
import org.beetl.sql.mapper.annotation.SqlResource;

import java.util.List;

/**
 * 角色 菜单 dao
 */
@Mapper
@SqlResource("system.RoleMenu")
public interface RoleMenuMapper extends IBaseExtMapper<RoleMenuEntity> {
    /**
     * 根据角色ID删除菜单权限
     */
    void deleteByRoleId(@Param("roleId") Long roleId);

    /**
     * 根据角色ID查询选择的菜单权限
     */
    List<Long> queryMenuIdByRoleId(@Param("roleId") Long roleId);

    /**
     * 根据角色ID集合查询选择的菜单权限
     */
    List<MenuEntity> selectMenuListByRoleIdList(@Param("roleIdList") List<Long> roleIdList, @Param("deletedFlag") Integer deletedFlag);

    /**
     * 查询所有的菜单角色
     */
    List<RoleMenuEntity> queryAllRoleMenu();
}
